<?php

namespace app\common\model;

use think\Model;

class AttachmentModel extends BaseModel
{
    protected $table = 'attachment';

    public function add(array $data, int $file_type, int $user_id)
    {
        return $this->save([
            'storage' => $data['storage'],
            'file_name' => $data['file_name'],
            'file_path' => $data['file_path'],
            'file_size' => $data['file_size'],
            'file_ext' => $data['file_ext'],
            'file_url' => $data['file_url'],
            'file_md5' => $data['file_md5'],
            'file_type' => $file_type,
            'add_user_id' => $user_id,
        ]);
    }
}
